/* 
 * File:   Paddle.cpp
 * Author: jose
 * 
 * Created on 5 de Abril de 2012, 20:19
 */

#include "Paddle.h"
#include "GameDefinitions.h"

Paddle::Paddle(std::string filename) {
    paddleImage = SdlUtils::loadImage(filename);
}

Paddle::Paddle(const Paddle& orig) {
}

Paddle::~Paddle() {
}


void Paddle::moveUp(Uint32 deltaTicks){
    if(posY>=0)
        posY -= paddleSpeed * (deltaTicks/1000.0f);
    else
        posY = 0;
}

void Paddle::moveDown(Uint32 deltaTicks){
    if(posY<GameDefinitions::SCREEN_HEIGHT - paddleImage->clip_rect.h)
        posY += paddleSpeed * (deltaTicks/1000.0f);
    else
        posY = GameDefinitions::SCREEN_HEIGHT - paddleImage->clip_rect.h;    
}

